package com.chen.testfluentvalidator;

import com.baidu.unbiz.fluentvalidator.FluentValidator;
import com.baidu.unbiz.fluentvalidator.Result;
import com.baidu.unbiz.fluentvalidator.ResultCollectors;

/**
 *TODO
 *@author：email: <a href="cyb@ewppay.com"> Administrator </a> 
 *@Date 2017-4-24 下午4:00:06 
 */

public class TestValidator {

	public static void main(String[] args){
		Car car = new Car();
		
		Result ret = FluentValidator.checkAll()
		                            .on(car.getLicensePlate(), new CarLicensePlateValidator())
		                            .on(car.getManufacturer(), new CarManufacturerValidator())
		                            .on(car.getSeatCount(), new CarSeatCountValidator())
		                            .doValidate()
		                            .result(ResultCollectors.toSimple());
		 
		System.out.println(ret);
	}
}
